package org.robot.scm.platform.schedule;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.robot.scm.platform.AbstractSchedule;
import org.robot.scm.pojos.platform.server.ExecuteParam;

/**
 * 中午12:00清理历史数据
 *
 * @Author : Awn create on 2025/5/19 15:26
 */
@Slf4j
public class NoonCleanJob extends AbstractSchedule implements CommonCleanJob {


    @Override
    public void handle() {
        clean();
    }

    @Override
    public ExecuteParam getParam() {
        // 将当前日期传进去，方便每天分批清理，避免一次清理大量数据
        String uploadFileKey = upload(cronConfig(), log);
        if (StringUtils.isBlank(uploadFileKey)) {
            return null;
        }

        ExecuteParam param = new ExecuteParam();
        param.setFileKey(uploadFileKey);
        param.setMec15(Boolean.TRUE);
        param.setMec16(Boolean.TRUE);
        param.setMec17(Boolean.TRUE);
        return param;
    }

    @Override
    public String getName() {
        return "noonCleanJob";
    }

}
